﻿<!DOCTYPE html>
<!--基础管理类隐患排查库管理-->
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>
<body>
    <div id="app" v-cloak class="popupW100">
        <el-form :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px" size="mini" label-position="right">
            <el-row>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div> {{RisksManagement.InvestigationItems.DatabaseName+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.Database" slot="suffix" :placeholder="RisksManagement.InvestigationItems.DatabaseName">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in Database" :label="item.label" :value="item.id">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.InvestigationItems" autocomplete="off" size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.InvestigationItems.InvestigationItems+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            
            </el-row>
          

            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSubmit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>

    </div>
    <script type="text/javascript">

        var app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    Database: '',
                    InvestigationItems: ''
                },
                Database: [],
                mydata: RisksTree,
                //表单验证
                rules: {
                    Database: [
                        verification.NotNull,
                    ],
                    InvestigationItems: [
                        verification.NotNull,
                    ]
                }
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/InvestigationItems/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });

                },
                getData: function () {
                    getData(this, '/api/InvestigationItems/get?id=' + this.id);
                }
            },
            mounted: function () {
                //this.Database = getDicData('300');
                this.Database = fn(this.mydata, "0");
                this.id = getUrlParam("id");
                this.getData();
              
            }
        });
    </script>
</body>

</html>